<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="/tld/dictionary" prefix="dictionary"%>
<%@ taglib uri="/tld/flowdictionary" prefix="flowdictionary"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>卖单明细</title>
<link rel="stylesheet" href="${ctx}/static/css/style.css" type="text/css" /> 
<link rel="stylesheet" href="${ctx}/static/css/style1.css" type="text/css" /> 
<link rel="stylesheet" href="${ctx}/static/css/kongjian.css" type="text/css" />
<link rel="stylesheet" href="${ctx}/static/css/m.css" type="text/css" />
<script src="${ctx}/static/script/jquery-1.4.min.js" type="text/javascript"></script>
<script src="${ctx}/static/script/jquery.ui.core.js"></script>
<script src="${ctx}/static/script/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
</head>

<body style="margin:10px;">
<p style="padding-bottom:5px;">
<a id="a_m1"  class="a_m"  style="background:#fff; border-left:0;" onclick="view(1)">卖单信息</a>
<a id="a_m2" href="#" class="a_m" onclick="view(2)">卖单明细</a>
</p>
<form:form id="mainform1" name="mainform1" action="${ctx}/order/sell_order_execute"  modelAttribute="sellOrderMainForm" method="post" >
<input type="hidden" name="id" id="id" value="${sellOrderMainFormList.sellOrderId}"/>
<div style=" border:#3b97e4 solid 1px; padding:10px 0 20px;" id="t1">
<table class="m_table">
	<tr>
		<td>投资编号：${sellOrderMainFormList.sellOrderMain.investInfo.id}</td>
	</tr>
	<tr>
		<td>理财客户姓名：${sellOrderMainFormList.sellOrderMain.investInfo.customerInfo.cnName}</td>
	</tr>
	<tr>
		<td>理财客户编号：${sellOrderMainFormList.sellOrderMain.investInfo.customerInfo.customerCode}</td>
	</tr>
	<tr>
		<td>卖单金额：<fmt:formatNumber value="${sellOrderMainFormList.sellOrderMain.sellOrderAmt}" pattern="##,###.##" /></td>
	</tr>
	<tr>
		<td>应收金额：<fmt:formatNumber value="${sellOrderMainFormList.sellOrderMain.receivableAmt}" pattern="##,###.##" /> </td>
	</tr>
	<tr>
		<td>已收金额：<fmt:formatNumber value="${sellOrderMainFormList.sellOrderMain.receiveAmt}" pattern="##,###.##" /></td>
	</tr>
	<tr>
		<td>约定交易日期：<fmt:formatDate value="${sellOrderMainFormList.sellOrderMain.appointPaymentDate}"   pattern="yyyy-MM-dd" type="date" dateStyle="long" />  </td>
	</tr>
	<tr>
		<td>是否尽快转让：
		<c:if test="${sellOrderMainFormList.sellOrderMain.isExpress=='1'}">
		是
		</c:if>
		<c:if test="${sellOrderMainFormList.sellOrderMain.isExpress=='0'}">
		否
		</c:if>
	</td>
	</tr>
	<tr>
		<td>申请日期：<fmt:formatDate value="${sellOrderMainFormList.sellOrderMain.createDate}"   pattern="yyyy-MM-dd" type="date" dateStyle="long" /></td>
	</tr>
	<tr>
		<td>状态：<flowdictionary:display code="${sellOrderMainFormList.sellOrderMain.flowId}" /></td>
	</tr>
	<c:if test="${sellOrderMainFormList.sellOrderMain.investInfo.productType=='00140001'||sellOrderMainFormList.sellOrderMain.investInfo.productType=='00140002'}">
	<tr>
		<td>固定类预计卖出手续费：<fmt:formatNumber value="${sellOrderMainFormList.sellOrderMain.deadlineExpectSellAmt}" pattern="##,###.##" /></td>
	</tr>
	</c:if>
	<c:if test="${sellOrderMainFormList.sellOrderMain.investInfo.productType!='00140001'&& sellOrderMainFormList.sellOrderMain.investInfo.productType!='00140002'}">
	<tr>
		<td>非固定类预计卖出手续费：<fmt:formatNumber value="${sellOrderMainFormList.sellOrderMain.expectSellAmt}" pattern="##,###.##" /></td>
	</tr>
	<tr>
        <td>转让服务费折扣率：${sellOrderMainFormList.sellOrderMain.sellFeeDiscount*100}%
        </td>
	</tr>
	</c:if>
	<tr>
        <td valign="middle"><span style="float:left;">备注：${sellOrderMainFormList.sellOrderMain.memo}</span></td>
	</tr>
	 <c:if test="${sellOrderMainFormList.mark=='centerManBuy'}">
	<tr>
        <td>实际交易日期：<input type="text" id="appointPaymentDate" name="appointPaymentDate"  value="<fmt:formatDate value="${sellOrderMainFormList.sellOrderMain.appointPaymentDate}"   pattern="yyyy-MM-dd" type="date" dateStyle="long" />" readonly="true"/>
        </td>
	</tr>
	<tr>
	    <td colspan="2">
	    <input type="submit" class="btn1" style="margin-right:15px;" value="购买"/>
	    <a href="#" onclick="window.location=('${ctx}/sellOrder/sell_order_list?p=history');"  class="btn1">取消</a>
	    </td>
	</tr>
	 </c:if>
	 <c:if test="${sellOrderMainFormList.mark=='detail'}">
	 <tr>
	    <td colspan="2">
	    	<a href="#" onclick="window.location=('${ctx}/sellOrder/sell_order_list?p=history');"  class="btn1">返回</a>
	    </td>
	 </tr>
	</c:if>
</table>

</div>
</form:form>
<form:form id="mainForm2" action="#" modelAttribute="sellOrderMainFormList" method="post">
<div style=" border:#3b97e4 solid 1px; padding:10px 0 20px;" id="t2">
<input type="hidden" name="pageNo" id="pageNo" value="${page.pageNo}"/>
<input type="hidden" name="sellOrderId" id="sellOrderId" value="${sellOrderMainFormList.sellOrderId}"/>
   <div class="shenqing2">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
            <td width="61">债权编号：</td>
            <td width="150px" style="color:#2E74D1;"><input type="text" id="loanId" name="loanId" value="${sellOrderMainFormList.loanId}" class="ggkj_inputtext_80" /></td>
            <td width="85">原债权人：</td>
            <td width="150px" style="color:#2E74D1;"><input type="text" id="customerName" name="customerName" value="${sellOrderMainFormList.customerName}"  class="ggkj_inputtext_80"  />
            </td>
            <td width="85">卖单明细编号：</td>
            <td width="150px" style="color:#2E74D1;"><input type="text" id="sellOrderDtlId" name="sellOrderDtlId" value="${sellOrderMainFormList.sellOrderDtlId}"  class="ggkj_inputtext_80"  />
            </td>
			 <td width="93"><input name="Input" type="button" class="chaxun_btn" value="&nbsp;&nbsp;查询" onclick="reQuery()"/>
             </td>
          </tr>
      </table>
    </div>
	<div class="yiban" id="r2">
	<table style="width:100%;" class="ggkj_table"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th scope="col">序号</th>
    <th scope="col">卖单明细编号</th>
    <th scope="col">债权编号</th>
    <th scope="col">卖单编号</th>
    <th scope="col">原债权人</th>
    <th scope="col">债务人</th>
    <th scope="col">对价金额</th>
    <th scope="col">卖出比例</th>
    <th scope="col">已售出比例</th>
    <th scope="col">约定交割日期</th>
    <th scope="col">irr</th>
  </tr>
  	<c:forEach items="${page.result}" var="item" varStatus="status">
		<c:choose>
  			<c:when test="${status.count%2==0}">
  				<tr class="ggkj_tdColr">
  			</c:when>
  			<c:otherwise>
  				<tr >
  			</c:otherwise>
		</c:choose>
		 <td>${status.count+(page.pageNo-1)*10}</td>
		  <td>${item.id}</td>
		  <td>${item.loanId}</td>
		  <td>${item.ftTSellOrderMain.id}</td>
		  <td>${item.ftTSellOrderMain.investInfo.customerInfo.cnName}</td>
		  <td>${item.loanName}</td>
		  <td><fmt:formatNumber value="${item.amt}" /></td>
		  <td><fmt:formatNumber value="${item.scale}" pattern="#0.000#" /></td>
		  <td><fmt:formatNumber value="${item.receiveScale}" pattern="#0.000#" /></td>
		  <td><fmt:formatDate value="${item.ftTSellOrderMain.appointPaymentDate}"   pattern="yyyy-MM-dd" type="date" dateStyle="long" /></td>
		  <td><fmt:formatNumber value="${item.irr}" pattern="#0.0#" /></td>
		  </tr>
	</c:forEach>
</table>
<div class="ggkj_pagecontainer">
  <div class="ggkj_pageBGleft">
    	<span class="ggkj_pageBGright"></span>
    	<a href="javascript:jumpPage(1)" class="ggkj_pageUpa">
        
        </a>
        <a href="javascript:jumpPage(${page.prePage})" class="ggkj_pageUp">
        
        </a>
        <span class="ggkj_insertline"></span>
        <span class="ggkj_pageSpan">
        	页<input type="text" id="pageNo" name="pageNo" class="ggkj_inputtext_30" value="${page.pageNo}">OF ${page.totalPages}
        </span>
        <span class="ggkj_insertline"></span>
        <a href="javascript:jumpPage(${page.nextPage})" class="ggkj_pageDown">
        
        </a>
        <a href="javascript:jumpPage(${page.totalPages})" class="ggkj_pageDowna">
        
        </a>
    </div>
</div>
</div>
</div>
</form:form>
<script language="JavaScript">
	function jumpPage(pageNo) {
		document.getElementById('pageNo').value=pageNo;
		ajaxQuerySellOrderDetail();
	}
	function view(x){
		for(i=1;i<3;i++){
			document.getElementById("t"+i).style.display="none";
			document.getElementById("a_m"+i).style.background="#fff";
		}
		document.getElementById("t"+x).style.display="block";
		document.getElementById("a_m"+x).style.background="#c6defa";
	}
	document.body.onkeypress=function() 
{ 
    if   (event.keyCode   ==13){ 
    	reQuery();
    }	
}
function reQuery(){
		document.getElementById('pageNo').value="1";
		ajaxQuerySellOrderDetail();
}
	function ajaxQuerySellOrderDetail(){
	var pageNo=document.getElementById("pageNo").value;
	var sellOrderId=document.getElementById("sellOrderId").value;
	var loanId=document.getElementById("loanId").value;
	var customerName=document.getElementById("customerName").value;
	var sellOrderDtlId=document.getElementById("sellOrderDtlId").value;
	var url="${ctx}/sellOrder/ajax_sellorder_detail?pageNo="+encodeURI(pageNo)+"&sellOrderId="+encodeURI(sellOrderId)+"&loanId="+encodeURI(loanId)+"&customerName="+encodeURI(customerName)+"&sellOrderDtlId="+encodeURI(sellOrderDtlId);
	$("#r2").load(url);	
}
</script>
</body>

</body>
</html>
